Fixed some bugs in the frame.