Fixed: erd_depth was not updated.