Cover template-related fixes, --debugtemplates flag