Fix for issue 791