I always bake for less time than the recipe states. As a rule of thumb, I start checking at 15 minutes.
Also, I've heard (and agree) that if you insert a toothpick and it comes out clean, your cupcakes are overdone. If there's a bit of cupcake crumbs stuck to the toothpick when you pull it out (but doesn't look completely undercooked), then they are done.
I also take them out of the pan quickly because I they continue to bake a little bit.