Cases were in the wrong order to detect a terminal switching to itself