Change Flags check to the correct way.