Fix error in check for undefined.