cppcheck fixes part 1.

I'll deal with ++i changes, editor and luabind changes in another commit.

Part of #227