Fixes from Debian and RedHat

This pull request includes a couple of patches coming from Debian and RedHat.