fix some minor bugs.