Added test cases related to #683
Merge pull request #783 from vmattila/gh683

Added test cases related to #683