Fix for issue #518.