Fixed most of code issue.

Start to work on begin_edit restriction on ST3.
Fixed create new file error on ST3.