Fixed bugs for drawing of device\frame