packaging fixes

I am updating this package in Debian and along the way have made some vendor-agnostic fixes. Please review and merge.