Properly handle flags.