Fixed some minor bugs in tests