fixed encoding of collections objects

fixed crash in python3 x86_64 if double precision option was specified.