Fixes #204
This covers at least the specific instances from the bug report.
Still need to figure out a general way to identify these automatically
to make sure all are fixed.