Fixed loading of templates