A fix for issue #595