Fixed fencepost bug