Fix some minor bugs.