Add null checks to analyst and user templates.