Corrected some logic errors when moving the arrow that indicates the active panel