Fixes static analyzer warnings