compiles on Windows
Template fixes
Merge pull request #5275 from ricardoquesada/compiles_on_win

Compiles on win