Fixed mutation while enumerating exception.

Closes #139 and closes #138