Chase down all the sensor inputs to the TCM and check the wiring harness connectors for loose, corroded, burnt contacts. Tach Sensor, Speed sensor in the rear axle, FIPL voltage, MLPS values in different gears, and make sure the Brake light bulbs and contacts are clean and working correctly...