More static analysis fixes