Improved the marshalling of arrays