Change sort to use fixed-sized buffers and increase arity if things fit per Ivan