Misc fixes mostly relating to phpdoc and PhpStorm