Fix typo and template location bugs