Added workaround for serializing iterables to JSON