Test case for #774

The tests fail for me (before the fix), but should pass with the fix in #775.