Correcting comparison error