Fixed buggy test logic