Fixed typos, some bugs remain