Don't segfault when cleaning files