fixed some minor things  notified by the cppcheck static analyzer