Fixes in serialization and reflection