Revert "Revert "Issue #37." due to issue #42."

This reverts commit 3a7bac7b0a08716a16c70311929864c3ac3d4609.
Fix for bug #42 (Collecions fail to serialize).
Merge branch 'issue42'