Corrected a logic in test