OOIION-1654: Fixed cleanup of duplicate directory keys