Fixed broken tests, added more phpdoc