Fixing issue #681
Fixing issue #682