Fix for #2359
Merge pull request #2716 from eliangidoni/fix-2359

Fix for #2359 by @eliangidoni