fix extend_fields and test