Restored test cases for #2304 and #2348