Fix for issue #667