Fix metadata cursor dup and search_near.