The start of a fix for #90 (and #88 at the same time)