fix cppcheck errors

Should fix issue #463.
What do you think?