Tidying up code to address some generator warnings