Fix max memory counter.