Fixing control flow