Fix NPE in serialization on FetchQuery.