Fixed file IO in test case.