Fix some bugs and may finish.