fixed problems with ellipse and rectangle drawing