Fix #114

I'm sure this isn't perfect but it does get things working...