Fixing error, adding functions to parse templates.
Formatting