Fixed some enum and array marshaling mistakes found while reproducing issue #32