I find that setting duty to 0 allows the pin to float
and that can cause a fet to turn on.
I add a weak pull down resistor to the pin used
or set the output to low when duty=0