refs  #1338
add test for #1338; code cleanup