Bad meshes are a common problem in using computational electromagnetics codes. Often, much of an engineer's or analyst's time ids wasted improving a mesh until the solver finally converges. We investigate the problem as it comes up in integral equation methods, and observe that its effects can be detected by analyzing the singular values of the electric field integral equation matrix. Armed with this information, we automatically remove the undesirable degrees of freedom caused by the ill-shaped mesh elements, so that the iterative solver behaves as if they were not present, all without any extra effort by the user. An a posteriori error estimator is developed, which verifies the improved accuracy for test problems and also suggests potential future applications in adaptive mesh refinement for integral equation methods. Further numerical examples demonstrate the improved solution convergence.