fix functions with no return statement and others
cppcheck errors