Address review comments

- Delete files we create if any fail
- Add tests for preallocFiles and preallocFile