Fix collection encoding.