Fixed last unit tests, mapping and corrected some phpdoc issues.