Fix some fencepost errors; add terminators