Fix early exit from do...while