Fix for issue #246