random fixes/cleanups

because ajf wanted me to send the pull request