Fix inserting documents over the old API