Fix for warnings detected by clang static analyzer