Fix some template bugs when the user is not logged in.