Quick fixes based on PhpStorm inspections

* Remove unused local variables
* Add missing namespaces