Fixing bug in COUNT trigger where trigger was applied to size of buffer rather than number of tuples actually being received