Issue #4: writeNullableObject fixed