ported stream engine fix from ZeroMQ (0c0a351fa5ffed3b66206eac6b77cef2fb316151
Merge pull request #146 from somdoron/StreamEngineFix

ported stream engine fix from ZeroMQ