fixed some errors with comparisons