Fixed flag passing in type checks