Fix serialization issues