Fixes and improvements from Debian

Here are fixes and improvements that we've accumulated in Debian.