Fixing serialization errors