Fix ResolveEnvVar function and add support of tilde (~/...)