Fix a bug where axioms with multiple RHS might be incorrectly applied in a certain situation.