Fixed some editor bugs, cleanup