Yes both codes would come from MAF wires not being connected, Air temp sensor is part of the MAF sensor on your year.
Vacuum leak would make idle high.
Fuel injected engines can't use an idle screw, no jets to meter fuel by air flow, so they all use an IAC(idle air control) Valve.
It will be on the upper intake where throttle plate is, it looks like an electric motor, because it is.
It opens a valve in an air passage that bypasses throttle plate, computer controls this motor.
Make sure wires got plugged back in.
Another thing is the ECT(engine coolant temp) sensor, computer uses this sensor to tell..........engine temp.
Cold engine needs more fuel and higher idle or it will stall, that is what the Choke plate did on carb engines, but again, no jets with EFI, so computer has to know engine temp to run engine in Choke Mode, then run it normally after engine warms up.
The engine should still have 2 temp devices in 2005 I think, one for the computer(ECT sensor) and one for the dash board gauge(ECT sender), Ford did combine them into one sensor around this time.
But 1 or 2 it/they will be on the thermostat housing, make sure they are plugged in