Increased precision of pi, bettered error handling