Fixed templates to work with tornado