fixed bug in inv_stack_recon, where total xs was ignored