Fix frame/localvar handling