[Rebased]: Remove use of typeof for undefined properties

Closes #692