Fix for issue #288 and some phpdoc cleanup.