More mbstowcs overflow fixes. Again, byte count v. element count.
Replace min+max pairs with Maths::clamp.