Fix minor bugs.
big commit