Fix various tests

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