Quickselect, cleanup, mem leak fix.