cppcheck fix part 3/3.

cppcheck output isn't clean but I won't deal with luabind related warnings
and false positives.

Closes #227