Fixing bugs found by static analysis