Fix code to pass phpunit RULE tests