Refactored and changed asUndefined behaviour to use new field