Fix editor bugs

Fixes bugs in the editor reported by issue #1238.