fix bad environment replacement in cassette