Added suport for stacks when doing an extract