Fix array issue when `$saved_terms` is not an array