Fixing a crash in the unit tests.