Better handling of unterminated blocks