Some fixes for PHPUnit
Completed user unit test