Fixed errors

- Rewrite was escaping a closing paren it should not.
- New "switch version" logic was assuming a $viewModel was present, and
  it wasn't.
Merge branch 'hotfix/85'