Delete files after close and some other unit tests fixed