Fix incorrect logic in test.