Template updates and bug fixes