Various improvements (mostly around map to array serialization)