Cleanup generated code for const access