Fix for issue #1018.