The temperature gauge looks a bit high to me though on idle...make sure your viscous fan is working properly....when the engine is cold you should be able to stop the fan with a rolled up newspaper...once the engine warms up the newspaper should not stop the fan!
Also make sure you have bled the system properly...on the M40 the front of the car should be parked facing up a hill or on jacks. You need to bleed out the air at the metal screw on the thermostat housing and also on the large black plastic screw on the plastic reservoir bottle next to the radiator. Also use the correct anti-freeze/water ratio.
Do not get confused about the method of adjusting the idle. The throttle cable must be relaxed and the screw that adjusts the throttle opening is factory set as stated and should not be moved..if it has been moved then adjust this screw until the "butterfly" virtually closes off the throttle body.
At this stage you should hear the TPS switch under the throttle body "click" as the throttle is relaxed...this means the TPS switch is making properly and tells the ECU to handle the idle.
The fact that you have the idle fine now means that you have achieved this so do not move that throttle stop screw again!
That spare connector is definitely for the carbon canister...I have cable tied mine out of the way.
The screw on the AFM is for the Oxygen mixture...if you have bad fuel economy you will need to have the air mixture checked and then adjusted at that screw.
Good luck with your M40...it is a great engine if you replace the timing belt when due and maintain the oil and oil filter changes. Sludgey oil will block the small holes that oil the camshaft lobes and cause early wear...engine gets noisy and will not rev into the red!




