Better flag value checks