Static analysis fixes