fixed typos and minor bugs