Fixes for aggregates and single. Added more tests