Add checks for some variables in the edit form that could be undefined