Fixed typos and bugs