fixing typos and PHPDoc