Fix for negative tests on metadata having null or "" value.

Optimization for listProducts