As part of routine maintenance, cleaning the MAF can help to lessen and/or prevent these issues.  Cleaning the MAF sensor can help and frequently can solve the issue if it is that sensor that is malfunctioning.  This can be done at home. Simply pull the part out, clean it, and then put it back on your engine's air intake system.