Fix collection serialization in case constructs

Fixes #1088