Fix drawing of cursor