Fixed the warnings

Fixed the code so to eliminate warnings related to shadowing and unused
parameters. In some settings, these warnings may be treated as an errors
and lead to failed build.

Suggested by Nikita Manovich.