Fix error in tail fitting