Fixes for XML serialization