Fixed mako templates to run in debian

It seems mako doesn't run safely under python 3.2.
Casted functions as str's in order to run safely.