Fix a bug when navigating to a slide multiple steps away.