Fix issue #50
Fix issue #57
Fix issue #70