Fixed references to shadow globals that won't exist unless doShadowMatch is true.