fixed possible error with ScrolledWindow

also added an initial implementation for purified average