Fix bug in editor