Fixed bug with short messages crashing, out of bounds with substringToIndex