Okay guys, I just wanted to share with you something real quick that I've discovered over the past couple of months performing. This works in countless sticky situations and absolves most of them completely and instantly.
If a person heckles you, or calls out the solution, just smile, put your hand up, and high five them.
Spectator: "You put it in your pocket."
Magician: "Haha, put it up." High five. "Check this out..."
Spectator: "That was a lame one."
Magician: "Rock on" High five. "Check this out..."
This tactic accomplishes many things at once to completely defuse the tough customer and allow you to continue with a successful, untainted performance.

Shows your ability to laugh at yourself and not take yourself or your magic too seriously

Confidence / Security

Puts the spectator in a position where they have to let you off the hook or THEY look like the fool

Either way you can't be perceived as a fool.

Keeps the interaction fun and shuts down the heckling cold.
After you high five, if you go on to do a good (preferably easy) trick, they will react and completely forget about the heckler. Remember, people will always remember your hits and forget your misses.
All you have to do to recover from a miss is perform a hit, and a high five is a great bridge between the two.
- Daniel Tyler