@mengxr It's error-prone to reuse the name `numBlocks`, too, but that didn't stop the previous author.  I can remove the shadowing problem everywhere if you prefer.