Fixed errors found by PhpStorm