Finished implementation of marshalling.