Added run tests by main and some fixes