more fixes to marshalling