Prevent String::Mid from creating invalid strings