Fencepost error in refactor