Comment 9 for bug 1170017

I've adapted the patch in comment #6 by Dr. Amr Osman (dr3mro). Built and tested locally on saucy and it seemed to work for me, so I uploaded it. Thanks!