More tidying up of the example code.