Fix upserts