Fix newly introduced null reference exception caught by unit tests.