[Rebased]: Remove use of typeof for undefined properties