fix for #628
added test for #628
Merge pull request #622 from mmklee/tr628

Tr628