Fix all kinds of bugs.