Instead I'm using a Tinkerkit MOSFET module which, by the way, doesn't use an IRF520S but in my case, a IRF3806 which gives 15,8mOhms RDSon @VGS=10V so much better than the original.
It drives a fuel pump comprising a Mabuchi 370
Now, I didn't bother using the library and I'm feeding it PWM through analogWrite instead.
As always with a hardware issue you have to show us your hardware... schematic?
photo? What are the various supplies? What's powered from what? What's a Mabuchi370
(ie post links to data, not just names - you've already searched, don't make us all do it please).
Again we need to see what you have, full sketch, link to data on that MOSFET
module, a diagram of how you have it all connected and details of how everything
is powered...
I mean, there is a freewheeling diode on the MOSFET module, that's what we're talking about, right?
Google for snubber circuit, it's a capacitor in series with a resistor and it is used in ac circuit, that diode you mentioned does have another purpuses.