Ensure string like obj are str not unicode
fix aggregation function