Fix 227

with tests