The NULL ptrs appear because there isn't any row created, so for example when calling EM_SETSEL without setting a text it will call editor_ensure_visible which will make the program crash because there are no rows, in windows this doesn't happen.
I did the call to TxSetText in CreateTextServices because the call to create_text_service is also made in WM_CREATE of the richedit window and it made the call to TxSetText by it self.