Invariant subspaces and control of decoherence