Some fixes from use in anger.