Small cleanup on stream-related stuff.
Bugfixes & improvement on parsing.