Fix 'may be used uninitialized' warnings found by cppcheck