Merge pull request #254 from mikeh/master

Pull req. 253 and unit test fixes