correct some minor bugs