Fix crash on removing bad map from index