fix some minor bugs