Fix for issue #291