Wrong check for dir_is_empty().