Fix NPE when the key is null in GroupBy