Introduce isUndefined helper function, reindent.