Fixing template rendering on python 3