fixed crashing on new machine, when no battery stats exists yet
adding tests