Fix warnings by static analyzer