Fixed various typos and some additional phpdoc.