Fix regression on do/end blocks, closes #1551