I admit to not understanding the A= B= construct. This hack was the only way I could figure out to make the flags properly conditionalize.