Fix stream_wrapper_unregister error issue

This should fix issue #256