Fixed a bug in Get_battery_percent