Test case for Issue #1.
Fix Issue #1

Last bits were not flushed correctly.
Merge pull request #5 from cybercase/fixissue1

Fix Issue #6