Escape scope names starting with dollar sign in smtio.py