fixed some corner cases in editor