Fix range merge bug in IndexSet, modify other parts of framework reliant on Range