Fixed bugs, update doc