pass sequences by const ref; add missing template args