Hmmm... I'm not following the logic of the 3 way sort. It might have been right previously (comparing `v[mi]` with `v[hi]`--sorry if I misled), but please look at it carefully.  I would do
```julia
b < a  => swap(a,b)
c < b => swap(b,c)
b < a => swap(a,b)
```
But what you had before might be equivalent.  This currently isn't.