Minor tidy up and sorting fix