Correct some major bugs.