Rattling after you turn off the key is usually engine run-on AKA dieseling. It is caused by hot spots in the cylinders (usually carbon deposits) acting like glow plugs and igniting the fuel air mix after the key is turned off. EFI vehicles however cut off the fuel injectors along with the ignition so the only way it could diesel is if you have a couple leaky injectors that are dribbling some fuel even when they are supposed to be closed.
Leaky injectors can also explain the hard starting as the fuel rail is supposed to stay pressurized at all times unless you depressurize the system to work on it and leaking injectors allow the pressure to bleed off while the engine is off. This floods the intake with raw fuel and makes it hard to start the next time.
Try adding a bottle of a good fuel injector cleaner such as Techron concentrate to your next tank of fuel and see if that helps any.
|