Fixed model cast issues.
Rectangles can now be drawn while a polygon is not yet finished.