fixing typos and minor bugs