Fixed some tests that were dependent on internal random sorting