Some fixes from CM