Fix  Missing version numbers (issue #228)

The fix is very ugly, but is the only thing I can do in order to keep the changes minimal. The template rendering mechanism is somehow heterogeneous. Time for a deep code cleanup and refactor?