Fix issue #6
Fix issue #17