Fix for issue #1158