Fixed issue with get_dynamic_fields()

I made the check `if obj` more specific when looking for dynamic fields. If an object had `__len__` implemented it would be called which is undesirable.