Small fixes
Add regression test