Fixing relation and serialization stuff