Fix issues found by the PhpStorm code inspector