Fixes static analyzer warnings. Part 1
Adds missing semiconlon
Fixes static analyzer warnings. Part 2
Fixes static analyzer warnings. Part 3
Fixes static analyzer warnings. Part 4