Fix some warnings. Unset container when removing a painter.
Reset the first draw flag when the painter has been removed.