Backport #1506 from 1.2.5
Merge pull request #1604 from sjinks/issue-1506

Backport #1506 from 1.2.5