moved assignment of templateName to within file handling
some cleanup
Merge pull request #23 from mastoj/master

Fix for #22