Fix logic error in checking of products.