Resolves #553, Resolves #546 - bug fixes with unit tests

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Merge pull request #554 from dnephin/more_defensive_stream

Fix a couple bugs with 1.0 release and Docker 1.3