Fixing coding errors flagged by static analyzer