Fix minor bugs in tests