Fixed various typos and some additional phpdoc.
Fix comments.
Merge branch '4.1'