Small changes after a code inspection

Fixed:
1. Unneeded comma
2. Unnecessary semicolon
3. Implicity declared global variables
4. Duplicate variable declaration