[bugfix] Expression state not properly reset throughout function calls