Fix #50 template not found on Windows OSes.

This PR supersedes  #52 and closes #50.

@birdage I tested it with simple Windows and Linux examples.  But we should add a proper test later to avoid re-surfacing this bug in the future.