Fixed a variable scoping problem that happened while rendering a single page in the template