Bugfix #978.
Merge pull request #1086 from alex-zen/bugfix-978

Bugfix #978.