Perfectly-Matched Layers (PML) are widely used in Particle-In-Cell simulations, in order to absorb electromagnetic waves that propagate out of the simulation domain. However, when charged particles cross the interface between the simulation domain and the PMLs, a number of numerical artifacts can arise. In order to mitigate these artifacts, we introduce a new PML algorithm whereby the current deposited by the macroparticles in the PML is damped by an analytically-derived, optimal coefficient. The benefits of this new algorithm is illustrated in practical simulations.