fixed bugs in streams and made AUnit tests work