count() and serialize() should be uniform.
Merge pull request #2960 from bar/patch-2

count() and serialize() should be uniform.