Fix tests by sorting arrays