fix minor bugs