Fix crash in unit test.