Fixed segfaults after change size_t of "s"