diff --git a/src/vte.cc b/src/vte.cc
index 292725c..39d308a 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -367,6 +367,31 @@ _vte_terminal_set_default_attributes(VteTerminal *terminal)
         terminal->pvt->fill_defaults = terminal->pvt->defaults;
 }
 
+/* Top padding not included */
+static glong
+_vte_row_to_pixel(VteTerminal *terminal,
+                  glong row)
+{
+        return row * terminal->pvt->char_height - (glong) round(terminal->pvt->screen->scroll_delta * terminal->pvt->char_height);
+}
+
+/* Top padding not included */
+// FIXME: find a good name
+static glong
+_vte_pixel_to_scrolldeltapixel(VteTerminal *terminal,
+                               glong y)
+{
+        return y + round(terminal->pvt->screen->scroll_delta * terminal->pvt->char_height);
+}
+
+/* Top padding not included */
+static glong
+_vte_pixel_to_row(VteTerminal *terminal,
+                  glong y)
+{
+        return _vte_pixel_to_scrolldeltapixel(terminal, y) / terminal->pvt->char_height;
+}
+
 /* Cause certain cells to be repainted. */
 void
 _vte_invalidate_cells(VteTerminal *terminal,
@@ -374,7 +399,6 @@ _vte_invalidate_cells(VteTerminal *terminal,
 		      glong row_start, gint row_count)
 {
 	cairo_rectangle_int_t rect;
-	glong i;
 
 	if (G_UNLIKELY (!gtk_widget_get_realized(&terminal->widget)))
                 return;
@@ -388,32 +412,12 @@ _vte_invalidate_cells(VteTerminal *terminal,
 	}
 
 	_vte_debug_print (VTE_DEBUG_UPDATES,
-			"Invalidating cells at (%ld,%ld+%ld)x(%d,%d).\n",
+			"Invalidating cells at (%ld,%ld+%f)x(%d,%d).\n",
 			column_start, row_start,
-			(long)terminal->pvt->screen->scroll_delta,
+			terminal->pvt->screen->scroll_delta,
 			column_count, row_count);
 	_vte_debug_print (VTE_DEBUG_WORK, "?");
 
-	/* Subtract the scrolling offset from the row start so that the
-	 * resulting rectangle is relative to the visible portion of the
-	 * buffer. */
-	row_start -= terminal->pvt->screen->scroll_delta;
-
-	/* Ensure the start of region is on screen */
-	if (column_start > terminal->pvt->column_count ||
-			row_start > terminal->pvt->row_count) {
-		return;
-	}
-
-	/* Clamp the start values to reasonable numbers. */
-	i = row_start + row_count;
-	row_start = MAX (0, row_start);
-	row_count = CLAMP (i - row_start, 0, terminal->pvt->row_count);
-
-	i = column_start + column_count;
-	column_start = MAX (0, column_start);
-	column_count = CLAMP (i - column_start, 0 , terminal->pvt->column_count);
-
 	if (!column_count || !row_count) {
 		return;
 	}
@@ -427,26 +431,31 @@ _vte_invalidate_cells(VteTerminal *terminal,
 	 * by multiplying by the size of a character cell.
 	 * Always include the extra pixel border and overlap pixel.
 	 */
-	rect.x = column_start * terminal->pvt->char_width - 1;
-	if (column_start != 0) {
-		rect.x += terminal->pvt->padding.left;
-	}
-	rect.width = (column_start + column_count) * terminal->pvt->char_width + 3 + terminal->pvt->padding.left;
-	if (column_start + column_count == terminal->pvt->column_count) {
-		rect.width += terminal->pvt->padding.right;
-	}
+        rect.x = terminal->pvt->padding.left + column_start * terminal->pvt->char_width - 1;
+        if (rect.x <= terminal->pvt->padding.left)
+                rect.x = 0;
+        /* Temporarily misuse rect.width for the end x coordinate... */
+        rect.width = terminal->pvt->padding.left + (column_start + column_count) * terminal->pvt->char_width + 2; // why 2 and not 1?
+        if (rect.width >= terminal->pvt->padding.left + terminal->pvt->column_count * terminal->pvt->char_width)
+                rect.width = terminal->pvt->padding.left + terminal->pvt->column_count * terminal->pvt->char_width + terminal->pvt->padding.right;
+        /* ... fix that here */
 	rect.width -= rect.x;
 
-	rect.y = row_start * terminal->pvt->char_height - 1;
-	if (row_start != 0) {
-		rect.y += terminal->pvt->padding.top;
-	}
-	rect.height = (row_start + row_count) * terminal->pvt->char_height + 2 + terminal->pvt->padding.top;
-	if (row_start + row_count == terminal->pvt->row_count) {
-		rect.height += terminal->pvt->padding.bottom;
-	}
+        rect.y = terminal->pvt->padding.top + _vte_row_to_pixel(terminal, row_start) - 1;
+        if (rect.y <= terminal->pvt->padding.top)
+	        rect.y = 0;
+
+        /* Temporarily misuse rect.height for the end y coordinate... */
+        rect.height = terminal->pvt->padding.top + _vte_row_to_pixel(terminal, row_start + row_count) + 1;
+        if (rect.height >= terminal->pvt->padding.top + terminal->pvt->row_count * terminal->pvt->char_height)
+                rect.height = terminal->pvt->padding.top + terminal->pvt->row_count * terminal->pvt->char_height + terminal->pvt->padding.bottom;
+        /* ... fix that here */
 	rect.height -= rect.y;
 
+        /* Ensure the values make sense */
+        if (rect.width <= 0 || rect.height <= 0)
+                return;
+
 	_vte_debug_print (VTE_DEBUG_UPDATES,
 			"Invalidating pixels at (%d,%d)x(%d,%d).\n",
 			rect.x, rect.y, rect.width, rect.height);
@@ -1787,11 +1796,11 @@ vte_terminal_emit_adjustment_changed(VteTerminal *terminal)
 		terminal->pvt->adjustment_changed_pending = FALSE;
 	}
 	if (terminal->pvt->adjustment_value_changed_pending) {
-		glong v, delta;
+		double v, delta;
 		_vte_debug_print(VTE_DEBUG_SIGNALS,
 				"Emitting adjustment_value_changed.\n");
 		terminal->pvt->adjustment_value_changed_pending = FALSE;
-		v = round (gtk_adjustment_get_value(terminal->pvt->vadjustment));
+		v = gtk_adjustment_get_value(terminal->pvt->vadjustment);
 		if (v != terminal->pvt->screen->scroll_delta) {
 			/* this little dance is so that the scroll_delta is
 			 * updated immediately, but we still handled scrolling
@@ -1814,9 +1823,12 @@ vte_terminal_queue_adjustment_changed(VteTerminal *terminal)
 }
 
 static void
-vte_terminal_queue_adjustment_value_changed(VteTerminal *terminal, glong v)
+vte_terminal_queue_adjustment_value_changed(VteTerminal *terminal, double v)
 {
 	if (v != terminal->pvt->screen->scroll_delta) {
+                _vte_debug_print(VTE_DEBUG_ADJ,
+                                 "Adjustment value changed to %f\n",
+                                 v);
 		terminal->pvt->screen->scroll_delta = v;
 		terminal->pvt->adjustment_value_changed_pending = TRUE;
 		add_update_timeout (terminal);
@@ -1824,7 +1836,7 @@ vte_terminal_queue_adjustment_value_changed(VteTerminal *terminal, glong v)
 }
 
 static void
-vte_terminal_queue_adjustment_value_changed_clamped(VteTerminal *terminal, glong v)
+vte_terminal_queue_adjustment_value_changed_clamped(VteTerminal *terminal, double v)
 {
 	gdouble lower, upper;
 
@@ -1925,10 +1937,15 @@ _vte_terminal_adjust_adjustments_full (VteTerminal *terminal)
 static void
 vte_terminal_scroll_lines(VteTerminal *terminal, gint lines)
 {
-	glong destination;
+	double destination;
 	_vte_debug_print(VTE_DEBUG_ADJ, "Scrolling %d lines.\n", lines);
 	/* Calculate the ideal position where we want to be before clamping. */
 	destination = terminal->pvt->screen->scroll_delta;
+        /* Snap to whole cell offset. */
+        if (lines > 0)
+                destination = floor(destination);
+        else if (lines < 0)
+                destination = ceil(destination);
 	destination += lines;
 	/* Tell the scrollbar to adjust itself. */
 	vte_terminal_queue_adjustment_value_changed_clamped (terminal, destination);
@@ -6691,7 +6708,7 @@ vte_terminal_start_selection(VteTerminal *terminal, long x, long y,
 	delta = terminal->pvt->screen->scroll_delta;
 	terminal->pvt->has_selection = TRUE;
 	terminal->pvt->selection_last.x = x;
-	terminal->pvt->selection_last.y = y + (terminal->pvt->char_height * delta);
+	terminal->pvt->selection_last.y = _vte_pixel_to_scrolldeltapixel(terminal, y);
 
 	/* Decide whether or not to restart on the next drag. */
 	switch (selection_type) {
@@ -6973,7 +6990,7 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
 {
 	VteScreen *screen;
 	int width, height;
-	long delta, residual;
+	long residual;
 	struct selection_event_coords *origin, *last, *start, *end;
 	VteVisualPosition old_start, old_end, *sc, *ec, *so, *eo;
 	gboolean invalidate_selected = FALSE;
@@ -6991,9 +7008,6 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
 	so = &old_start;
 	eo = &old_end;
 
-	/* Convert the event coordinates to cell coordinates. */
-	delta = screen->scroll_delta;
-
 	/* If we're restarting on a drag, then mark this as the start of
 	 * the selected block. */
 	if (terminal->pvt->selecting_restart) {
@@ -7019,7 +7033,7 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
 	origin = &terminal->pvt->selection_origin;
 	if (terminal->pvt->selection_block_mode) {
 		last->x = x;
-		last->y = y + height * delta;
+		last->y = _vte_pixel_to_scrolldeltapixel(terminal, y);
 
 		/* We don't support always_grow in block mode */
 		if (always_grow)
@@ -7037,7 +7051,7 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
 	} else {
 		if (!always_grow) {
 			last->x = x;
-			last->y = y + height * delta;
+			last->y = _vte_pixel_to_scrolldeltapixel(terminal, y);
 		}
 
 		if ((origin->y / height < last->y / height) ||
@@ -7056,15 +7070,15 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
 		 * closer to the new point. */
 		if (always_grow) {
 			/* New endpoint is before existing selection. */
-			if ((y / height < ((start->y / height) - delta)) ||
-			    ((y / height == ((start->y / height) - delta)) &&
+			if ((y / height < ((start->y / height) /* - delta wtf ??? fixme */)) ||
+			    ((y / height == ((start->y / height) /* - delta wtf ??? fixme */)) &&
 			     (x / width < start->x / width))) {
 				start->x = x;
-				start->y = y + height * delta;
+				start->y = _vte_pixel_to_scrolldeltapixel(terminal, y);
 			} else {
 				/* New endpoint is after existing selection. */
 				end->x = x;
-				end->y = y + height * delta;
+				end->y = _vte_pixel_to_scrolldeltapixel(terminal, y);
 			}
 		}
 	}
@@ -7337,10 +7351,11 @@ vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
 	width = terminal->pvt->char_width;
 	height = terminal->pvt->char_height;
 
-	_vte_debug_print(VTE_DEBUG_EVENTS,
-			"Motion notify (%ld,%ld) [%ld, %ld].\n",
-			x, y,
-			x / width, y / height + terminal->pvt->screen->scroll_delta);
+// FIXME
+//	_vte_debug_print(VTE_DEBUG_EVENTS,
+//			"Motion notify (%ld,%ld) [%ld, %ld].\n",
+//			x, y,
+//			x / width, y / height + terminal->pvt->screen->scroll_delta);
 
 	vte_terminal_read_modifiers (terminal, (GdkEvent*) event);
 
@@ -8058,19 +8073,19 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
 	gboolean was_scrolled_to_top = (screen->scroll_delta == _vte_ring_delta(ring));
 	gboolean was_scrolled_to_bottom = (screen->scroll_delta == screen->insert_delta);
 	glong old_top_lines;
-	glong new_scroll_delta;
+	double new_scroll_delta;
 
         if (terminal->pvt->selection_block_mode && do_rewrap && old_columns != terminal->pvt->column_count)
                 vte_terminal_deselect_all(terminal);
 
 	_vte_debug_print(VTE_DEBUG_RESIZE,
 			"Resizing %s screen\n"
-			"Old  insert_delta=%ld  scroll_delta=%ld\n"
-                        "     cursor (absolute)  row=%ld  (visual line %ld)  col=%ld\n"
+			"Old  insert_delta=%ld  scroll_delta=%f\n"
+                        "     cursor (absolute)  row=%ld  col=%ld\n"
 			"     cursor_saved (relative to insert_delta)  row=%ld  col=%ld\n",
 			screen == &terminal->pvt->normal_screen ? "normal" : "alternate",
 			screen->insert_delta, screen->scroll_delta,
-                        terminal->pvt->cursor.row, terminal->pvt->cursor.row - screen->scroll_delta + 1, terminal->pvt->cursor.col,
+                        terminal->pvt->cursor.row, terminal->pvt->cursor.col,
                         screen->saved.cursor.row, screen->saved.cursor.col);
 
         cursor_saved_absolute.row = screen->saved.cursor.row + screen->insert_delta;
@@ -8156,6 +8171,8 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
 			   TODO: What would be the best behavior if the bottom of the screen is a
 			   soft line break, i.e. only a partial line is visible at the bottom? */
 			new_scroll_delta = below_viewport.row - terminal->pvt->row_count;
+			/* Keep the old fractional part. */
+			new_scroll_delta += screen->scroll_delta - floor(screen->scroll_delta);
 			_vte_debug_print(VTE_DEBUG_RESIZE,
 					"Scroll so bottom row stays\n");
 		}
@@ -8167,11 +8184,11 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
         screen->saved.cursor.col = cursor_saved_absolute.col;
 
 	_vte_debug_print(VTE_DEBUG_RESIZE,
-			"New  insert_delta=%ld  scroll_delta=%ld\n"
-                        "     cursor (absolute)  row=%ld  (visual line %ld)  col=%ld\n"
+			"New  insert_delta=%ld  scroll_delta=%f\n"
+                        "     cursor (absolute)  row=%ld  col=%ld\n"
 			"     cursor_saved (relative to insert_delta)  row=%ld  col=%ld\n\n",
 			screen->insert_delta, new_scroll_delta,
-                        terminal->pvt->cursor.row, terminal->pvt->cursor.row - new_scroll_delta + 1, terminal->pvt->cursor.col,
+                        terminal->pvt->cursor.row, terminal->pvt->cursor.col,
                         screen->saved.cursor.row, screen->saved.cursor.col);
 
 	if (screen == terminal->pvt->screen)
@@ -8252,13 +8269,13 @@ vte_terminal_set_size(VteTerminal *terminal, glong columns, glong rows)
 static void
 vte_terminal_handle_scroll(VteTerminal *terminal)
 {
-	long dy, adj;
+	double dy, adj;
 	VteScreen *screen;
 
 	screen = terminal->pvt->screen;
 
 	/* Read the new adjustment value and save the difference. */
-	adj = round (gtk_adjustment_get_value(terminal->pvt->vadjustment));
+	adj = gtk_adjustment_get_value(terminal->pvt->vadjustment);
 	dy = adj - screen->scroll_delta;
 	screen->scroll_delta = adj;
 
@@ -8271,9 +8288,9 @@ vte_terminal_handle_scroll(VteTerminal *terminal)
 
 	if (dy != 0) {
 		_vte_debug_print(VTE_DEBUG_ADJ,
-			    "Scrolling by %ld\n", dy);
+			    "Scrolling by %f\n", dy);
 		_vte_terminal_scroll_region(terminal, screen->scroll_delta,
-					   terminal->pvt->row_count, -dy);
+					   terminal->pvt->row_count, dy < 0 ? -dy + 1 : -dy - 1); // FIXME
 		vte_terminal_emit_text_scrolled(terminal, dy);
 		_vte_terminal_queue_contents_changed(terminal);
 	} else {
@@ -9875,9 +9892,12 @@ vte_terminal_expand_region (VteTerminal *terminal, cairo_region_t *region, const
 
 	/* increase the paint by one pixel on all sides to force the
 	 * inclusion of neighbouring cells */
-	row = MAX(0, (area->y - terminal->pvt->padding.top - 1) / height);
-	row_stop = MIN(howmany(area->height + area->y - terminal->pvt->padding.top + 1, height),
-		       terminal->pvt->row_count);
+        row = _vte_pixel_to_row(terminal, MAX(0, area->y - terminal->pvt->padding.top - 1));
+        /* Both the value given by MIN() and row_stop are exclusive.
+         * _vte_pixel_to_row expects an actual value corresponding
+         * to the bottom visible pixel, hence the - 1 + 1 magic. */
+        row_stop = _vte_pixel_to_row(terminal, MIN(area->height + area->y - terminal->pvt->padding.top + 1,
+                                                   terminal->pvt->row_count * terminal->pvt->char_height) - 1) + 1; // explain
 	if (row_stop <= row) {
 		return;
 	}
@@ -9891,7 +9911,7 @@ vte_terminal_expand_region (VteTerminal *terminal, cairo_region_t *region, const
 	rect.x = col*width + terminal->pvt->padding.left;
 	rect.width = (col_stop - col) * width;
 
-	rect.y = row*height + terminal->pvt->padding.top;
+	rect.y = _vte_row_to_pixel(terminal, row) + terminal->pvt->padding.top;
 	rect.height = (row_stop - row)*height;
 
 	/* the rect must be cell aligned to avoid overlapping XY bands */
@@ -9911,7 +9931,7 @@ static void
 vte_terminal_paint_area (VteTerminal *terminal, const GdkRectangle *area)
 {
 	VteScreen *screen;
-	int width, height, delta;
+	int width, height;
 	int row, col, row_stop, col_stop;
 
 	screen = terminal->pvt->screen;
@@ -9919,9 +9939,12 @@ vte_terminal_paint_area (VteTerminal *terminal, const GdkRectangle *area)
 	width = terminal->pvt->char_width;
 	height = terminal->pvt->char_height;
 
-	row = MAX(0, (area->y - terminal->pvt->padding.top) / height);
-	row_stop = MIN((area->height + area->y - terminal->pvt->padding.top) / height,
-		       terminal->pvt->row_count);
+        row = _vte_pixel_to_row(terminal, MAX(0, area->y - terminal->pvt->padding.top));
+        /* Both the value given by MIN() and row_stop are exclusive.
+         * _vte_pixel_to_row expects an actual value corresponding
+         * to the bottom visible pixel, hence the - 1 + 1 magic. */
+        row_stop = _vte_pixel_to_row(terminal, MIN(area->height + area->y - terminal->pvt->padding.top,
+                                                   terminal->pvt->row_count * terminal->pvt->char_height) - 1) + 1; // explain
 	if (row_stop <= row) {
 		return;
 	}
@@ -9945,13 +9968,12 @@ vte_terminal_paint_area (VteTerminal *terminal, const GdkRectangle *area)
 
 	/* Now we're ready to draw the text.  Iterate over the rows we
 	 * need to draw. */
-	delta = screen->scroll_delta;
 	vte_terminal_draw_rows(terminal,
 			      screen,
-			      row + delta, row_stop - row,
+			      row, row_stop - row,
 			      col, col_stop - col,
 			      col * width,
-			      row * height,
+			      _vte_row_to_pixel(terminal, row),
 			      width,
 			      height);
 }
@@ -9959,11 +9981,10 @@ vte_terminal_paint_area (VteTerminal *terminal, const GdkRectangle *area)
 static void
 vte_terminal_paint_cursor(VteTerminal *terminal)
 {
-	VteScreen *screen;
 	const VteCell *cell;
 	struct _vte_draw_text_request item;
-	int row, drow, col;
-	long width, height, delta, cursor_width;
+	int drow, col;
+	long width, height, cursor_width;
 	guint fore, back;
 	PangoColor bg;
 	int x, y;
@@ -9972,16 +9993,13 @@ vte_terminal_paint_cursor(VteTerminal *terminal)
 	if (!terminal->pvt->cursor_visible)
 		return;
 
-	screen = terminal->pvt->screen;
-	delta = screen->scroll_delta;
         col = terminal->pvt->cursor.col;
         drow = terminal->pvt->cursor.row;
-	row = drow - delta;
 	width = terminal->pvt->char_width;
 	height = terminal->pvt->char_height;
 
-	if ((CLAMP(col, 0, terminal->pvt->column_count - 1) != col) ||
-	    (CLAMP(row, 0, terminal->pvt->row_count    - 1) != row))
+// FIXME: clamp on rows? tricky...
+	if (CLAMP(col, 0, terminal->pvt->column_count - 1) != col)
 		return;
 
 	focus = terminal->pvt->has_focus;
@@ -10002,7 +10020,7 @@ vte_terminal_paint_cursor(VteTerminal *terminal)
 	item.c = (cell && cell->c) ? cell->c : ' ';
 	item.columns = item.c == '\t' ? 1 : cell ? cell->attr.columns : 1;
 	item.x = col * width;
-	item.y = row * height;
+	item.y = _vte_row_to_pixel(terminal, drow);
 	cursor_width = item.columns * width;
 	if (cell && cell->c != 0) {
 		guint style;
@@ -10059,6 +10077,7 @@ vte_terminal_paint_cursor(VteTerminal *terminal)
 							     x, y,
 							     cursor_width, height);
 
+#if 0 // FIXME
                                 if (cell && terminal->pvt->show_match) {
                                         hilite = vte_cell_is_between(col, row,
                                                         terminal->pvt->match_start.col,
@@ -10067,6 +10086,7 @@ vte_terminal_paint_cursor(VteTerminal *terminal)
                                                         terminal->pvt->match_end.row,
                                                         TRUE);
                                 }
+#endif
                                 if (cell && cell->c != 0 && cell->c != ' ') {
                                         vte_terminal_draw_cells(terminal,
                                                         &item, 1,
@@ -10361,19 +10381,19 @@ vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event)
 	_vte_debug_print(VTE_DEBUG_EVENTS,
 			"Scroll speed is %d lines per non-smooth scroll unit\n",
 			(int) v);
-	cnt = v * terminal->pvt->mouse_smooth_scroll_delta;
-	if (cnt == 0)
-		return TRUE;
-	terminal->pvt->mouse_smooth_scroll_delta -= cnt / v;
-	_vte_debug_print(VTE_DEBUG_EVENTS,
-			"Scroll by %d lines, smooth scroll delta set back to %f\n",
-			cnt, terminal->pvt->mouse_smooth_scroll_delta);
-
 	if (terminal->pvt->screen == &terminal->pvt->alternate_screen &&
             terminal->pvt->alternate_screen_scroll) {
 		char *normal;
 		gssize normal_length;
 
+		cnt = v * terminal->pvt->mouse_smooth_scroll_delta;
+		if (cnt == 0)
+			return TRUE;
+		terminal->pvt->mouse_smooth_scroll_delta -= cnt / v;
+		_vte_debug_print(VTE_DEBUG_EVENTS,
+				"Scroll by %d lines, smooth scroll delta set back to %f\n",
+				cnt, terminal->pvt->mouse_smooth_scroll_delta);
+
 		/* In the alternate screen there is no scrolling,
 		 * so fake a few cursor keystrokes. */
 
@@ -10393,8 +10413,11 @@ vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event)
 		g_free (normal);
 	} else {
 		/* Perform a history scroll. */
-		cnt += terminal->pvt->screen->scroll_delta;
-		vte_terminal_queue_adjustment_value_changed_clamped (terminal, cnt);
+		// Fixme: ugly
+		double dcnt = v * terminal->pvt->mouse_smooth_scroll_delta;
+		dcnt += terminal->pvt->screen->scroll_delta;
+		terminal->pvt->mouse_smooth_scroll_delta = 0;
+		vte_terminal_queue_adjustment_value_changed_clamped (terminal, dcnt);
 	}
 
 	return TRUE;
@@ -12019,7 +12042,8 @@ vte_terminal_set_scrollback_lines(VteTerminal *terminal, glong lines)
 {
         VteTerminalPrivate *pvt;
         GObject *object;
-        glong scroll_delta, low, high, next;
+        glong low, high, next;
+        double scroll_delta;
 	VteScreen *screen;
 
 	g_return_if_fail(VTE_IS_TERMINAL(terminal));
diff --git a/src/vteaccess.cc b/src/vteaccess.cc
index e33b3fd..4349ba9 100644
--- a/src/vteaccess.cc
+++ b/src/vteaccess.cc
@@ -509,7 +509,9 @@ vte_terminal_accessible_text_scrolled(VteTerminal *terminal,
 	long delta, row_count;
 	guint i, len;
 
-	g_assert(howmuch != 0);
+// FIXME!
+//	g_assert(howmuch != 0);
+	if (howmuch == 0) return;
 
         row_count = vte_terminal_get_row_count(terminal);
 	if (((howmuch < 0) && (howmuch <= -row_count)) ||
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 04d8104..d585365 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -102,7 +102,7 @@ struct _vte_incoming_chunk{
 typedef struct _VteScreen VteScreen;
 struct _VteScreen {
         VteRing row_data[1];	/* buffer contents */
-        long scroll_delta;	/* scroll offset */
+        double scroll_delta;	/* scroll offset */
         long insert_delta;	/* insertion offset */
 
         /* Stuff saved along with the cursor */
