Fixed a core dump from the regression tests.
Fixed unit tests.
Merged tests.