test case & fix for #1848