Fixing mb_substr returning no data, fixing order of exceptions.