Fixing test logic