Fix a bug that caused taking hidden files into account when cleaning up