Fix: using provided functions to set flags properly.