Adding proposed fix for issue #562