this results in global state changes. We need to make sure to reset `emulate_booleans` to it's default afterwards.