Fixed issue with bugs appearing in the template