More memory utils.
Valgrind shows memory errors.