Minor fixes to ScanTS.R and added test for detecting outliers