Misc bug fixes and small features

This is a group of misc fixes that didn't each merit it's own pull request.
Each individual commit has more specific information, as well as references to the issue that they resolve.