fixed #11

Added tests to finish and verify the fix for this issue.