Fix the test error and clean up