fix encoding of collections type with value null