several fixes on Unit Test