Dude, everyone messes up. That is why people (both magicians and the laiety) love magic- because they KNOW it's a trick, they just don't know HOW it's a trick. This knowledge makes them look at you and give you money (hopefully) or, on a good day, makes them see through you.
See, being caught isn't the end of the world, it's the begining. You learn something new every time that someone catches you- WHICH IS MORE IMPORTANT THAN SUCCESS.
That being said, practice is of upmost import- anyone can learn a trick in their free time but only a magician gets all the details right. I didn't perform magic until after I had worked on my sleights for 9 years- and while that may be a little extensive, it was certianly worth it in situations like this.
If you get a new effect, practice until you master it. Once you master it, keep practicing. When someone points out flaws, A: note said flaws to work on later and B: punish the meddlers.
Patter options: If someone says "I know how you did that," pull out some quip like "Well, that's not very impressive- I know it too" or "Yes, it's magic. Very good." Or "Really? Well, everyone give a round of applause to (insert name of meddler here)"- then hand them a deck of cards, sit in front of them and stare.
Sleight options: If they know how one sleight is done, beat them with another, more tricky sleight.
"The enthusiast will not rest until every sleight in the calendar has been perfectly mastered, so that he may be enabled to nonplus and squelch that particularly obnoxious but ever present individual, who with his smattering of the commoner sleights always knows 'exactly how it is done'"- S. W. Erdnase