Fixed double comparison bug