Made DM activation more robust.