Made some DM tests more robust