Reversed an old patch.
Workaround to get free of issues when some devices is charging
More work to gain more stability.
Many code modification to suppress warnings introduced unexpected behaviour.