Fix a few cppcheck findings

why did you remove the error checking?