Various battery device detection fixes