Bug fix for #138.
Closes #153.