Throw a more specific exception when serializing null collection properties
Fixes #1328