Fixed an error in getbat