Merge pull request #331 from gavincornwell/master

Unit test fixes.