Fix typo in battery segment implementation

Fixes #1229
Merge commit 'HEAD@{1}' into develop