fixes based on PHPStorm inspection