Tidied up a bit of code.