Misc fixes to get this template to work properly