Canvas tile layer renderer occasionally glitches when panning fast

When panning fast with the canvas tile layer renderer, occasionally incorrect tiles are shown. I suspect that this is due to incorrect use of already loaded tiles.