Fix php tags in template

As noted in #474 here is a pull request for fixing PHP tags in template.