more text_len casting fixes