Fixed null pointer in tests.