Fix bug when comparing generator with non generator.