Phase diagram and influence of defects in the double perovskites