Make event and tick counts in Flags use the proper types.
Make some local variables use the proper types.
Create a MismatchBehavior enum and use it instead of 'int'.