Updated secret key generation test
Fixed bugs in templating engine

--HG--
branch : templating
Merge changes from templating branch