Add battery stats refreshing

and fix build