Fixed broken logic in test