replaced speedometer driven gear with recommended 40 tooth and still not accurate...

Perhaps when you disturbed the cable and put it back on, it picked up a slight bind which would keep it from turning as it should. I had similar issues when I replaced my speedo cable. The bouncing under 10 was probably the cable binding and release, bind and release. Anywho, glad ya got it.
Thanks!