Nothing wrong with Yamalube @ 40:1. Everything is wrong with your jetting!
KDX's are notoriously rich from the factory. If you are fouling plug and spittin’ spooge it’s not your premix ratio, it’s the jetting.
Checkout C-Dave’s site for jetting suggestions. Remember, in order to find the proper jetting you will need to…
1) Run the same fuel and mixture;
2) Use a fresh spark plug;
3) Use a clean airfilter;
4) Have a clean silencer (one that isn’t soaked in spooge). While you’re at it, inspect the powervalves and the inside of your pipe and clean as necessary;
5) Have a lot of jets in hand. I would suggest mains in the range of 150, 152 and 155. Pilots in the range of 38, 40, 42 and 45.
As mentioned above, 40:1 is a richer mixture than 32:1. We’re talking fuel, not oil here. For a given amount of premix, 40:1 contains more fuel than 32:1.