Fixed empty result list bug that occurs for some databases