fix quick select.

Note indexing of begin (inclusive), end(exclusive)