bug #945564 by sreynen, tim.plunket, canarymason: check that variables exist before using them; remove redundant page template call