Fix to drawing functions