Fix bug with scope analysis.