EG: fixed all sorting bugs; without threads the

order of results is quite deterministic.  With threads, some tests had to be more precise regarding sorting, or be more flexible in accepting results as correct.  This has largely been fixed.  However, repeatedly running the test might still reveil issues.