Some fixes in the templates. refs #500