Bug fix in defect retrieval