fix minor bugs and typos