Issue 90

It should be 'N', not 'M'.

By the way, why didn't you write

```
if !(all these)
{
  valid_id = false;
  break;
}
```
instead of empty braces?