Fixed search issue - error logged if a template is deleted, but a module still uses it