Fixed a bug regarding mb_substr