Removed some bugs from the templates