Engine: fix static analysis issues