minor fix for `CollectionSerializer` (backport from 2.4.0)