Jonathan's clean-up of the g_canvas.c