Adjusted zoomToFit function.