Dev cleanup

Here's a few patches that I wrote while trying to bootstrap a development environment. Perhaps they are useful for other people as well?