Tidy up code from all debug changes for testing the code.