Fix for ghost dirs cleanup.