port over fixes from the CR