fix memory allocation problem

In case nLookup and/or nBackup is large (sum > 50/60),
buffer overflows can and will happen.

(NB: happens even when not using GV, which is another bug that should be fixed)