Fix bug where shortcuts in plan cause planning failure.