Fixed caps errors, and old code in the templates