Prevent NPE in unittests.