fixing control flow parsing and scanning