Fixed loading templates, added check const BadCMS in template