fix variable types and some typos in phpdoc comments