Clean up relations before serialise