Partial fix to #1328
Merge pull request #1330 from sliux/master

Partial fix to #1328