Swap buffer data and a fix for assertions.