Fix checking for variable declarations shadowing parameters.

Fixes #617