Fix test logic