I bought a D17D at auction that started and idled pretty good but had a bunch of farmer engineering “fixes” that needed to be reversed. One of the “fixes” was to bypass the fuel filters with an automotive electric fuel pump and filter. I got it home and found that it misfired above 12-1500 RPM so I cleaned/replaced and hooked up the original fuel filters which didn’t help the running at all. The injection pump was leaking so had it rebuilt with no change. Next the injectors were serviced and new tips installed. Now it runs worse. I cleaned the intake plumbing, bought a can of new diesel and ran a line directly from the can to the injector pump with no change. I checked the valve lash/valve springs and none were too tight or too weak so there is no problem there that I can see although I am still working on it. The timing tab is worn so I can’t read values but I marked it before pulling the pump and set it back like it was. I tried changing the timing while it was running and couldn’t tell much difference one way or the other but the lines are so stiff it can’t be changed much without loosening them. All indications to me are that the original timing is ok. It sounds bad above 1500 RPM with some black smoke and a little gray. What am I missing? I have manuals that refer to energy cells. What do they do and could they cause this problem? Oil pressure is good and it was represented as not using oil.