Some fixes from Robin

Leaving as a pull-request over the weekend in case anyone has objections. If not, I'll merge on monday.