Fix crash due to bad object marshalling