Replace usage of HasFlag with bit masking for consistency with other code