Fix semantic operator error: '-eq' is used for number comparison
Fix flawed consistency check