Simple build fixes

Here is the pull request from last week, modulo the commit that breaks for you and plus three more small fixes.