Make memory checking optional.