New sampleSummaries function and bugfixes