Hacky fix for crash described in github issue #59

This isn't the right way to fix it, but it'll stop tills crashing for
now.  See issue #59 on github for a fuller discussion.