It sounds like there may be a faulty connection either at or inside the ecm. Check all the terminals in the plugs to ensure they are not misshapen. If you cannot find a problem you may want to replace the ecm.