Fixed a crash described in issue #197