EGR doesn't work at idle nor does it work when the engine is cold, so that wont be the cause of the idle speed error, unplug the throttle position sensor and see if it makes any difference when you rev it, in fact, leave it disconnected and you'll get more power and more mpg (only a bit!).
Black smoke is down to over fuelling, a trick which works alot of the time is to buy a new fuel filter but before you fit it, fill it with a good brand of diesel conditioner/cleaner. fire the engine up and take the car for a good blast up the road (drive it fairly hard) this will clean the injector pump which can get sediment in it and cause all sorts of problems.
Also, clean out the sedimenter at the back of the car, it's by the rear axle on the offside, don't just drain it but take it to bits and clean it out, make sure you fit a new 'o' ring to the 11mm bolt so as not to drag any air into the fuel system during normal driving.