Collection of small fixes

I made a handful of small changes that fix some issues I ran across when converting the template for my own use. Please see individual commits for details, and let me know if you have any questions about the changes I've made.