Refactored extractor averaging code.
Bugfix.