Fix a NPE in a test