test for #677 and #678