Fixed InputFlag checking