Ensured M is local, not global