test logic fixes