Added checkNotUndefined and associated test case.