fixes #41 - concating ended streams

This pull request is a suggested fix for issue 41