Tidied the debugging code.