Fixed several editor bugs