Fixes markup nesting on agent/edit.