Handle null property values

Fixes the error `TypeError: Cannot read property '_elem' of null` when a property has a value of `null`. Added assertion to test this case.