FIX: DIFFERENCE function - wrong results for stateless mode

Related to #1829 issue