Fix errors in Autocorrelation and Partial Autocorrelation functions; improve test generation