Gauge invariance and pseudoperturbations