Fix to template parser