Minor changes.
Added regression tests.