Fixed bug where requestAnimationFrame could not be cancelled.