fix functions with no return statement and other
cppcheck errors fix