Added buffer case
Added restore-context call to clear-theories
Added more things to ignore