Fixes in canvas rendering logic.