Fix issue #138
Fix issue #140