Fix 581 for now

This isn't perfect but maybe the best we can do without completely redoing the un/marshalling framework (which I guess we will do in future).