Fix batch produce kv reversal, add test case