Fixed some problems for tests