Fixes issue #65. Additional changes