Fixed #922.

See my post in #922 for details behind this.