Fix bug in determining the scope inside a catch clause

Closes #134