Enhanced the test so that it prints out more info in case problems occur.