Bug fixing.

Fixing a bug in the templating engine.