Fix static analysis issues