Fixes #1508.
Merge pull request #1553 from xiaohutai/bugfix-1508

Fixes #1508.