Spaces of vectors fixed by a type II representation of a discrete group, and their endomorphisms