Fix evaluation of while-statements