Fix replace with environment variable