Fix various tests

Nitpick: a named constant might be nice here; `MAX_MEMORY_CAP`?