Fixed the simple query API issues.