Fixing code to adhere to auto generated code