Fix $template and $db assignment as it's a leftover from the previous changes.