Added a test and a fix for the spurious data problem
Improved purgeObsoleteSamples so it better handles the case where all windows got expired...