Nonperturbative gauge fixing and perturbation theory