fixing minor errors e.g. redefined variable
Merge pull request #2747 from arthur-peka/master

fixing minor errors e.g. redefined variable