Fix value/2 query errors