Fix #770

Add test for #770