Fix 358

This contains some unit test for #358