Fixed exception when stream creation fails