Serialize class flags.
Fixed formatting.
Merged.