Bug fix on array serialization