Fix array overflow, improve tests fairness

Fixed array overflow for C-tests.
Improved tests fairness by allocating about ~128MB of memory rather than 128 * 10^20 ints