bug fixes around dragging and drawing