Microstructure and critical current of superconducting YBa2Cu3O7−x