Bugfix: close streams after reading