Fixed unit test logic