Fix UB/LB.