Fix issue with removing temporary files