Smoothness of the Distance Function Away from the Cut Locus