fix npe in tests