Changed the form the tests are created
Fixed pthread mode
Fixed automated tests