Debian fixes

Please see each commit message.