Fixed templates not being created properly