This solves #146

Fixes reported issue #146. It's probably not best way to do it, but I can't get any better idea at the moment...