Ok, you have a 4 wire MAF sensor. What you are concerned with is the Blue Signal wire and the Tan PCM ground. If you ground the Tan wire to chassis, you may cause a problem that doesn't actually exist. The MAF sensor takes 12V from the battery, and as in all 12V systems must ground somewhere, the chassis, eventually. Now the signal end of the sensor is the output from the sensor to the PCM. All the PCM cares about is seeing the proper voltage coming from the sensor, in a particular range. In your case .5 to 1.5V. The ground here is very imortant. It must be the same ground as the PCM. NOT THE CHASSIS! The two systems are separate, and crossing grounds can cause all sorts of wierd problems, including frying the PCM. So don't do that anymore. I could explain in detail why this is, but it doesn't solve your problem, so I'll save that for another discussion.
Anyway back to the problem at hand. So now you want to check out the the signal end of the sensor. First, make sure the connections to the PCM are tight. A loose connection could cause problems here. Once that is done, check out the MAF sensor connections. They should be clean, and make good contact. My wife hates it, but I use one of her nail files, or a small piece of emery cloth to clean the pins up. Just lightly sand them to remove any oxidation that may be present. Reconnect the MAF sensor and see if your problem goes away. (Be sure to clear any codes in the PCM, as it may use old data as a starting point, before it re-learns it's driving conditions. )
If the problem still exists, try wiggling the wiring harness, gentle and carefully, along the whole length of the harness all the way back to the PCM. We're again looking for a internal break in the wires. If there is no change, my first suspect is a bad MAF sensor, (they are a bit pricey, which is why I had you go through all these other steps first.) But I'm betting either a bad connection at the MAF, or the MAF itself.
Let me know what you find.