test for #767 and #766