Simplify the __clean_dir function which caused endless loops before