Fixed some redundancy after cppcheck