Fix bug in editor to drop unsaved changes and restore original profile