More fixes [WARNING: untested]