Cleanup and generated code improvements.