Fix NPE in serialization of empty results.