Miscellaneous cleanup

This branch cleans up a few minor issues with the codebase.