Fixed bug in expanding env vars used in the src or dest