Fix more warnings to make it pass -Wextra -Wshadow -Wunsafe-loop-optimizations

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Merge pull request #143 from paulfertser/master

Fix more warnings to make it pass -Wextra -Wshadow -Wunsafe-loop-optimiz...