Fix for issue #1004.