Catching memory errors.