Fixed calculation of l_stack_size