Fix bug with scopeOrder lengthening