make sure copy_env is not bypassed - fixes #564