misc fixes

This should get Travis builds working again, and fixes a few other things.
Please don't merge until the Travis build for the pull request is green.