more fixes after static analysis