Fixed wrong comparisons