Some code formatting, and phpdoc fixes