Fix some stupid syntax problem
Fix typos and many bugs, too lazy to mark all of them...