Add updateM to State effect
Fix name shadowing error when checking for linear patterns