Fix a bug in boolean simplification