Various changes/fixes from CM