Small fixes

This PR addresses some small portability-related and cosmetic issues, some of which were patched in the upcoming Debian package.