Problems with foreach loop and arrays caused array to grow in size.
Fix problem in for loop where extra ;'s in definition was not detected
Improve whitespace parsing in text blocks
Update template test result
Updated test for templates
Merge pull request #44 from atlesn/master

Fixes for templates