Add test and fix patch for #2304, refs #2341