Fixed up buildPolyFit interface and various import errors.