Fix bug in to_dict not handling which fields properly. Also add

exception for fields of type Object, since they're currently unhandled