Fixed upload files for replicas; initial modifications for exchange.