An efficient method to compute the scattering of a guided wave by a localized defect, in an elastic waveguide of infinite extent and bounded cross section, is considered. It relies on the use of perfectly matched layers (PML) to reduce the problem to a bounded portion of the guide, allowing for a classical finite element discretization. The difficulty here comes from the existence of backward propagating modes, which are not correctly handled by the PML. We propose a simple strategy, based on finite-dimensional linear algebra arguments and using the knowledge of the modes, to recover a correct approximation to the solution with a low additional cost compared to the standard PML approach. Numerical experiments are presented in the two-dimensional case involving Rayleigh-Lamb modes.