Major bug fixes, including template creation.