Tidy up the generated code a bit.