Superconductivity and microstructures of fluorinated and chlorinated YBa2Cu3Oz