Fix issue #242
Fix issue #236