Fixes two bugs (64bit assumption and template repeat call)
Merge pull request #2 from rikkimax/master

Fixes two bugs (64bit assumption and template repeat call)