Fixed BUG 400080.
Fixed in the count kernel. Making a copy of the count functor into local memory and then using it for comparison operations fixed the issue.