There are many library functions that return several parameters. Many of which you may not care about. Some functions allow you to pass NULL to ignore some returned parameters, but many do not.
For instance:
LinFit (X, Y, NbP, NULL, NULL, &Intercept, &Err);
if you are only interested in the Intercept and error values, will crash on run with a "Null pointer argument to library function" fatal error.
The way it's currently written , you have to (correctly) declare plenty of dummy arguments for your calls.