Fixed some phpdoc and format of code