Fix potential page template rendering failure to TAL. Add renderer tests.