Bug fix for query & listing APIs.