Fix a mutability bug.

Closes #722.