Fixes for issue #2391
Merge pull request #2584 from eliangidoni/fix-2391

Fixes for issue #2391