Changed the TE so that stacks are now handled properly