Fix bug 1004649
Merge pull request #4090 from pmorie/bugs/1004649

Fix bug 1004649