Fixed bugs and updated templates