scope comparison bug. Closes #1875