Fix check_consistency