Add regression test for #1
Add missing break statement, Fix #1