Bugfixes related to functional summary statistics
Merged upstream changes.