Correct some bugs.