Switched back and set flags properly.