stream_test.pl: averaging bugfix