A bad/stuck injector can make a diesel “lope” at idle. Check the crankcase oil and make sure it’s not overfilled and that it smells like oil, not diesel.
/ Lots of black smoke, I'm guessing turbo, am I right?
Branson 8050, IH 574, Oliver 1550 Diesel Utility (traded in on Branson) NH 8160. Kioti CK2620SECH
You found it, I would say.
After you check out the intercooler and lines and replace the bad ones I would check the wastegate to be sure she's not getting over boosted.