Fixed a seg fault from regression testing and also fixed a unit test error.