Non-detached and editable version of !354 (closed).
@matthieu.durocher originally contributed this fix.