Fixed wrong foreach warning in Result_manager.