remove unused code
fix #512. Group by should respect null values