After the sensor was replaced; it is then necessary to clear the computer codes with a code scanner. If the codes were not cleared with that tool; the light would stay on, and the car would not run normally. After the codes are cleared; the car will need to be driven for at least 1/2 hour under both city and highway driving; for the computer to relearn the engine's normal operational modes.
Once the codes are cleared; if the stalling continues; I would thoroughly clean the mass airflow sensor, idle air control valve and throttle body; and replace the spark plugs with Denso #4503 (also called PK16TT). This particular spark plug design is less likely to load up and cause stalling than most of the other recommended plugs for this model.