Fixed scope to_int and to_names conversion

```python
if name in SCOPE_NAME_DICT:
````