Pawel's defect2 changes