fix for #447, tests pending
add test case for #447
simplify