Fix NPE when running the test