Correct calculation of scope of quantified expressions