Fix to_text on fields bug