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.