remove obsolete unique visits function, fix accidentally not writing agg tables