Fix for Issue # 204

A new test has also been added for the fix. Please review and merge.