Template import fixes

Hi Joe,

While importing templates, I faced the same problem as mentioned in issue#6.
I've made some changes that seem to have fixed this issue. let me know what you think
about it. Thanks.

P.S. Thanks for making Gargl, I find it quite interesting.