Update resolve_expanded path to use locals and parameter expansion.