Fix NPE in test