Bugfixes for run_maxmem

Happened when running on the 8x system at work.  Peakmem is correctly picked up (check for non-0 instead of ==2). This removes a possible segfault later on.