Fixed a bug that caused some redrawing to be done on the main thread.