Fixd bugs for editor