fixed inner function tail recursive calls not being marked as such