converting bugs related to the conversion of terms to arrays or characters, and added new unit tests