Collection Tests

Adding collection tests to make sure collection sorting works the way it should.
Found some bugs with sorting while testing. Fixed those.