Merge: serialization: safe formal types, fix warnings in generated code and more