Fixed typos and minor bugs