Fix bug which caused custom templates to be stored permanently.