Close file after writing.
Stylistic fixes in test suite
Merge branch '#1512' of github.com:PKEuS/pandas