Added collector interface and some fixes.