fixed encoding of nil-values on entities

Previously, nil properties were not serialized at all; but to be able to query for those properties, they must be available.