Fixes for serialization