Bug fixes in defect transformations