Merge "Improve input event consistency invariants."