Fixed flaky test.

When N was small (N < 20000) one test started failing because of rounding errors.