Fixed bug introduced by fixing a bug.

I forgot that the inner scope isn't necessarily exited when updating
upperWasValid. (Additional iterations overwrote the result before the
upper level could read it.) This is fixed now. Inner level only adds to
the value, upper level resets it to 0 before going down.
Merge branch 'master' of https://github.com/eskimor/misc-stuff-including-D-programming-language-web-stuff