Made test index_write_test() remove the test file it has created. It can now be run twice in a row without failing.