Add more tests, fixed a (nasty) bug preventing re-use of files between
test runs