Zooming itself now seems to work fine, but the canvas-moving is buggy.
I fixed the canvas-moving when zooming. I also fixed the canvas-viewport-reset method.