Fix hidden bug on Debian systems

There's a nasty bug described here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711343

I have applied this fix and this still works well on my OpenSuse too.
Merge pull request #24 from mcnemesis/patch-1

Fix hidden bug on Debian systems