Fix regression in CoW, and add test