Fix rewriting of stack slots