Fix runtime error on windows
Add test for issue #142
Fix #142
Merged 'develop'.