misc fixes to the template