Fix buffer swap.