fixed some bugs, typos