More fixes (ported to 0.5).