Removed now unnecessary exception.
Fixed streams possibly not being closed.