fix exception for #64
fix by @derekhinchliffe
Merging from upstream