Renamed local variable to avoid scope collisions 

I'm not sure if C++ vars are scoped into {} blocks, but in ported code that is an issue. It's easier to have vars names unique. Does not harm anyone I guess? ;-)
Typo fixes
Rolled back to pull
Merge pull request #48 from Kromster80/test

Typo fixes