Fixed to run under debian with python 3.2

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