Fix for ticket #393.
Merge branch '1.7' into 1.8
Fixed #393 for 1.8