Tidy up the generation of the status string.