g10: Simplify some complicated boolean expressions.