Fix some bugs, and add some methods of the class stack.But still has
something unfinished.