Defect correction methods - theory and applications