Certainly try the WD40 trick first. If that doesn't fix them other things to try are replacing the cables and cable housings, check the derailleur alignment, check for bent derailleurs, clean the derailleurs and lubricate the hinge pins.
Good instructions for setting up and adjusting derailleurs can be found at:
www.parktool.com.