Fix some small issues

Fix some issues found by PhpStorm code inspection.
good catch