Fix bug where small vectors are not sorted