fixing typo
Using const-refs instead of copies when iterating vectors
several fixes to replace copied parameters with const refs.
type change