Addressed an "error" due to $templatelist being null