Fixed bugs in Tests.