fixed some minor bugs and typos