add failing test for #338
fix #338