Run cppcheck & remove some unused functions.