Check your derailleur hanger for proper alignment. If it's bent, it can cause all kinds of shifting problems.
If your frame has horizontal dropouts, make sure your wheel is installed straight and your quick release is locked down tight. The drive side can pull forward during hard pedaling.
Check you chain. Make sure it's a 10-speed chain (narrower than an 8- or 9-speed). Check for bent links and protruding pins.
tcpasley
Reduce, Reuse, Rebicycle