Fix for issue #268 and unit tests for it
Merge pull request #269 from lechat/fix_268

Fix for issue #268 and unit tests for it