Bug fixes in Cheetah template code.