Some minor tidying up of code.