sort() should not throw ArrayIndexOutOfBounds on empty array

apparently, this is allowed by the API
Merge pull request #35 from evacchi/sort-fix

sort() should not throw ArrayIndexOutOfBounds on empty array