Fix crash in unit test.
Merge pull request #122 from gavincornwell/master

Fix crash in unit test