Fixed some issues with streams