Correctly fix spurious maybe-uninitialized warning

OTS review by @mlucy
Closes #1674 and #1685