Fix #1139

Fixes #1139. Too much work for today...