Commuting properties of generalized inverses