The Λ effect describes a rotation-induced nondiffusive contribution to the Reynolds stress. It is commonly held responsible for maintaining the observed differential rotation of the Sun and other late-type stars. Here, the sensitivity of the Λ effect to small-scale magnetic fields and compressibility is studied by means of forced turbulence simulations either with anisotropic forcing in fully periodic cubes or in density-stratified domains with isotropic forcing. Effects of small-scale magnetic fields are studied in cases where the magnetic fields are self-consistently generated by a small-scale dynamo. The results show that small-scale magnetic fields lead to a quenching of the Λ effect which is milder than in cases where also a large-scale field is present. The effect of compressibility on the Λ effect is negligible in the range of Mach numbers from 0.015 to 0.8. Density stratification induces a marked anisotropy in the turbulence and a vertical Λ effect if the forcing scale is roughly two times larger than the density scale height.