Do you happen to know what the actual code numbers are? For instance P0300 will be your multiple cylinder misfire. Reason I ask is I'm wondering if one of the codes was actually indicative of a crank position sensor/circuit fault. That would lead to your running rough and stalling issues and could also result in P0300 since the ignition system in your vehicle relies on crank position for proper timing and firing order.

Im not sure if the computer would throw a TPS code for a crank sensor fault, but it's possible. It is however less likely for a faulty TPS to cause misfiring... hence my question.

Some other info that would help:
How many miles?
Have you done any recent maintenance or changed any parts?