Integral equations can enable the efficient and accurate solution of wave diffraction problems from piecewise uniform media. However, the usual quasiperiodic Green's function approach has certain disadvantages, including non-robustness. I will explain a spectrally-accurate alternative that combines free-space Green's kernels with a set of auxiliary particular solutions, whose coefficients are solved in the least squares sense. I will show how it is useful for various challenging Helmholtz and Maxwell problems in 2D and 3D.