Remove redundant transitions.