Merge "Fix crash in writing battery stats to health stats" into nyc-dev