A bunch of fixes

- fixed unit tests so they match Flash behavior
- fixed Vector sorting so it conforms to the new unit tests
- a couple of other nits
does the comment need to be updated (same for line 798)?