Backport fix receiving of incorrect queries in write_single