Fix bug with cleanupDocument when document is empty + make centerOnScroll true by default