Fix NPE when running local tests