Fix small bugs in typehinting, update stream class