Fix a cppcheck warning and fix code style a bit